/* Copyright (C) 2010 MoSync AB

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License, version 2, as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with this program; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/

// There are too many ways to convert between numeric and string types in MoSync.
// mastring.h, madmath.h, mastdlib.h and maxtoa.h all have functions for conversions.
// I just use this so I've got it all in one place...

#ifndef CONVERT_H_
#define CONVERT_H_

#include <MAUtil/String.h>
#include <matime.h>
using namespace MAUtil;

class Convert
{
	public:
		Convert();
		~Convert();

		static int toInt(String& input);
		static int toInt(const char* input);
		static double toDouble(String& input);
		static time_t toDateTime(String& input);

		static String toString(int input);
		static String toString(double input);

		static int hexToInt(const char* input);
};

#endif /* CONVERT_H_ */
